<?php
defined('_JEXEC') or die('Restricted access');
?>
<div class="mI mLang">
    <?php if ($headerText) : ?>
        <div class="langPreText"><?php echo $headerText; ?></div>
    <?php endif; ?>
    
    <?php if ($params->get('dropdown',1)) : ?>
        <form name="lang" method="submit">
        <select class="dropBox langDropBox" onchange="document.location.replace(this.value);" >
        <?php foreach($list as $language):?>
            <option value="<?php echo $language->link;?>" <?php echo $language->active ? 'selected="selected"' : ''?>><?php echo $language->title_native;?></option>
        <?php endforeach; ?>
        </select>
        </form>
    <?php else : ?>
        <ul class="clrfix langList">
        <?php foreach($list as $language):?>
            <?php if ($params->get('show_active', 0) || !$language->active):?>
                <li <?php if($language->active) echo 'class="active"' ;?>>
                <a href="<?php echo $language->link;?>" class="<?php echo $language->sef;?>">
                <?php if ($params->get('image', 1)):?>
                    <?php echo JHtml::_('image', 'mod_languages/'.$language->image.'.gif', $language->title_native, array('title'=>$language->title_native), true);?>
                <?php else : ?>
                    <?php echo $params->get('full_name', 1) ? $language->title_native : strtoupper($language->sef);?>
                <?php endif; ?>                
                </a>
                </li>
            <?php endif;?>
        <?php endforeach;?>
        </ul>
    <?php endif; ?>
    
    <?php if ($footerText) : ?>
        <div class="langPostText"><?php echo $footerText; ?></div>
    <?php endif; ?>
</div>
